package com.sskj.one.mine;


import com.hjq.toast.ToastUtils;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.MD5Util;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.one.presenter.BasePresenter;

/**
 * @author Hey
 * Create at  2019/05/22
 */
class PayPwdPresenter extends BasePresenter<PayPwdActivity> {

    public void getSMSCode(String mobile) {
        httpService.sendCode(mobile)
                .tag(this)
                .execute(new JsonCallBack<HttpData<Object>>(this) {
                    @Override
                    public void onHTTPSuccess(HttpData<Object> data) {
                        ToastUtils.show("发送成功");
                        mView.getCodeOK();
                    }
                });

    }

    public void setPayPwd(String mobile, String code, String pwd, String pwd1) {
        httpService.setPayPwd(mobile, code, MD5Util.getFiveMd5Value(pwd), MD5Util.getFiveMd5Value(pwd1))
                .tag(this)
                .execute(new JsonCallBack<HttpData>(this) {
                    @Override
                    public void onHTTPSuccess(HttpData data) {
                        mView.setPayPwdOK();
                    }
                });
    }

}
